miu1=4*pi*1e-7;
miu2=6*pi*1e-7;
epsilong1=1e-9/(36*pi);
epsilong2=2e-9/(36*pi);
Ei0=5;
w=2*pi*1e8;
k1=w*sqrt(miu1*epsilong1);
niu1=sqrt(miu1/epsilong1);
k2=w*sqrt(miu2*epsilong2);
niu2=sqrt(miu2/epsilong2);
Et0=Ei0*2*niu2/(niu2+niu1);
Er0=Ei0*(niu2-niu1)/(niu2+niu1);
z=[-20:0.1:0];
z1=[0:0.1:20];
m0=zeros(size(z));
t=100;
Ei=Ei0*cos(w*t-k1*z);
Hi=Ei0*cos(w*t-k1*z)/niu1;
Er=Er0*cos(w*t+k1*z);
Hr=-Er0*cos(w*t+k1*z)/niu1;
Et=Et0*cos(w*t-k2*z1);
Ht=Et0*cos(w*t-k2*z1)/niu2;
plot3(Ei,z,m0);
hold on
plot3(m0,z,Hi);
hold on
plot3(Er,z,m0);
hold on
plot3(m0,z,Hr);
hold on
plot3(Et,z1,m0);
hold on
plot3(m0,z1,Ht);
